<!DOCTYPE html>
<style>
    .class {
        -internal-visited-color: red;
    }
    .visited_color:visited {
        -internal-visited-color: red;
    }
</style>
<div>
    <a class="color">Should not be red</a><br>
    <a href="" class="color">Should not be red</a><br>
    <a href="" class="visited_color">Should not be red</a><br>
</div>
<script>
    let div = document.querySelector('div');

    // CSSOM:
    let cssom_div = div.cloneNode(true);
    for (let e of cssom_div.querySelectorAll('.color'))
        e.style.setProperty('-internal-visited-color', 'red');
    for (let e of cssom_div.querySelectorAll('.visited_color'))
        e.style.setProperty('-internal-visited-color', 'red');

    // CSS Typed OM:
    let css_typed_om_div = div.cloneNode(true);
    let set_silently = (elm, name, value) => {
        try {
            elm.attributeStyleMap.set(name, value);
        } catch (e) {
        }
    };
    for (let e of css_typed_om_div.querySelectorAll('.color'))
        set_silently(e, '-internal-visited-color', 'red');
    for (let e of css_typed_om_div.querySelectorAll('.visited_color'))
        set_silently(e, '-internal-visited-color', 'red');

    document.body.append(cssom_div, css_typed_om_div);
</script>
